<template>
  <div>
    <BetterTable ref="table" :columns="columns" :total-data="m_totalData">
      <template #btn>
        <el-button type="primary">操作按钮</el-button>
      </template>
      <template #operation>
        <el-button type="primary">按钮</el-button>
      </template>
    </BetterTable>
  </div>
</template>

<script>
import Tabel from "@/mixins/Tabel";
const columns = [
  { label: "时间", prop: "date" },
  { label: "姓名", prop: "name" },
  { label: "地址", prop: "address" },
  { label: "手机号", slots: "phone", width: 300 },
  { label: "操作", slots: "operation", fixed: "right" },
];
export default {
  mixins: [Tabel],
  data() {
    return {
      columns,
      totalData: {
        data: [],
        params: {
          pageNum: 1,
          pageSize: 10,
        },
        total: 0,
      },
      request: {
        post: this.getData,
        del: this.delData,
      },
    };
  },
  methods: {
    getData() {
      let result = {
        status: true,
        data: {
          list: [
            {
              id: 1,
              date: "2016-05-02",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1518 弄1111111111111",
            },
            {
              id: 2,
              date: "2016-05-04",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1517 弄",
            },
            {
              id: 3,
              date: "2016-05-01",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1519 弄",
            },
            {
              id: 4,
              date: "2016-05-03",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1516 弄",
            },
            {
              id: 5,
              date: "2016-05-02",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1518 弄1111111111111",
            },
            {
              id: 6,
              date: "2016-05-04",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1517 弄",
            },
            {
              id: 7,
              date: "2016-05-01",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1519 弄",
            },
            {
              id: 8,
              date: "2016-05-03",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1516 弄",
            },
            {
              id: 9,
              date: "2016-05-02",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1518 弄1111111111111",
            },
            {
              id: 10,
              date: "2016-05-04",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1517 弄",
            },
            {
              id: 11,
              date: "2016-05-01",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1519 弄",
            },
            {
              id: 12,
              date: "2016-05-03",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1516 弄",
            },
            {
              id: 13,
              date: "2016-05-02",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1518 弄1111111111111",
            },
            {
              id: 14,
              date: "2016-05-04",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1517 弄",
            },
            {
              id: 15,
              date: "2016-05-01",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1519 弄",
            },
            {
              id: 16,
              date: "2016-05-03",
              name: "王小虎",
              address: "上海市普陀区金沙江路 1516 弄",
            },
          ],
          total: 16,
        },
      };
      return result;
    },
  },
};
</script>
